package com.xsdlr.handler;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * Created by xsdlr on 2017/3/21.
 */
@Component("youzySchoolReadHandler")
public class YouzySchoolReadHandler implements DataHandler<String> {
    private String basePath;

    public YouzySchoolReadHandler(@Value("${school.search.baseURL.youzy}") String basePath) {
        this.basePath = basePath;
    }

    @Override
    public String handler(Map data) {
        String id = (String) data.get("id");
        String name = (String) data.get("name");
        return this.basePath + "?wd=" + name + "&id=" + id;
    }
}
